<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>增加学生</title>
<script type="text/javascript">
function addStudent(){
	var form=document.forms[0];
	form.action="/springMVC/user/adduser";
	form.method="get";
	form.submit();
}
	function selimage(){
		window.open("<%=basePath%>savestudentimage.jsp","","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=400,height=240,top="+(screen.availHeight-240)/2+",left="+(screen.availWidth-400)/2+"");}	
</script>
</head>
<body>
<!-- 方法1 -->
	<div style="text-align:center;">
		<h2>编辑学生信息</h2>
	</div>
<%-- <c:forEach items=${requestScope.studentList } var="student"> --%>
<c:if test="${!empty requestScope.messageSucc}">
		${requestScope.messageSucc}
</c:if>
<c:if test="${!empty requestScope.messageErr}">
		${requestScope.messageErr}
</c:if>
<form action="/SSH2/software/updateStudent"  method="post">
	<input type="hidden" name="student_id" value="${requestScope.student.getStudent_id() }"/>
	<div style="padding:5px;">
		姓名:<input type="text" name="name" style="width:200px;height: 30px;margin-left:10px;" value="${requestScope.student.getName() }"/>
	</div>
	<div style="padding:5px;">
	<c:if test="${requestScope.student.getSex()=='男' }">
		性别:<input type="radio" name="sex" value="男" checked="checked" style="margin-left:10px;"/>男
            <input type="radio" name="sex" value="女"/>女
	</c:if>
	<c:if test="${requestScope.student.getSex()=='女' }">
		性别:<input type="radio" name="sex" value="男" style="margin-left:10px;"/>男
            <input type="radio" name="sex" value="女" checked="checked" />女
	</c:if>
	</div>
	<div style="padding:5px;">
		学号:<input type="text" name="sno" style="width:200px;height: 30px;margin-left:10px;" value="${requestScope.student.getSno() }"/>
	</div>
	<div style="padding:5px;vertical-align: middle;">
		简介:<textarea name="description" style="margin-left:10px;width:250px;height:50px;"/>${requestScope.student.getDescription() }</textarea>
	</div>
	<div style="padding:5px;">
		图片:<input type="text" name="imageUrl" id="image" style="width:200px;height: 30px;margin-left:10px;" value="${requestScope.student.getImageUrl() }" onclick="selimage();"/>
	</div>
	<br>
	<c:if test="${!empty requestScope.messageSuc }">
		${requestScope.messageSuc }
	</c:if>
	<c:if test="${!empty requestScope.messageErr }">
		${requestScope.messageErr }
	</c:if>
    <div style="padding:5px;">
    		<input type="submit" value="提交修改" style="width:100px;height: 50px;background-color: gray;margin-left:50px;"/>
    </div>
</form>
<%-- </c:forEach> --%>
<%-- <h>添加班委</h>
<form action="/SSH2/software/addCommittee"  method="post">
姓名:<input type="text" name="name"/>
性别:<input type="radio" name="sex" value="男" checked="checked"/>男
    <input type="radio" name="sex" value="女"/>女
职务:<input type="text" name="duty"/>
工作简介:<input type="text" name="description"/>
图片：<input type="text" name="imageUrl"/>
<input type="submit" value="添加"/>
</form>
<c:if test="${!empty requestScope.messageSucc}">
		${requestScope.messageSucc}
</c:if>
<c:if test="${!empty requestScope.messageErr}">
		${requestScope.messageErr}
</c:if>

<br>
<h>添加活动</h>
<form action="/SSH2/activity/addActivity"  method="post">
活动标题:<input type="text" name="title"/>
活动内容:<input type="text" name="texts"/>
活动图片：<input type="text" name="imageUrl"/>
<input type="submit" value="添加"/>
</form>
<c:if test="${!empty requestScope.messageSucc}">
		${requestScope.messageSucc}
</c:if>
<c:if test="${!empty requestScope.messageErr}">
		${requestScope.messageErr}
</c:if> --%>
<!-- 方法2 -->
<!-- <h>添加用户</h>
<form action="">
姓名:<input type="text" name="username"/>name自动与相同字符实例化
年龄:<input type="text" name="age"/>
<input type="button" value="添加" onclick="addform"/> -->
</body>
</html>